﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TestSecurityAttribute.Models;
using Secure_Coding.MvcSecurityExtensions;

namespace TestSecurityAttribute.Controllers
{
    public class CustomerController : Controller
    {
        //
        // GET: /Customer/

        [HttpGet]
        public ActionResult Index()
        {
            Customer customer = new Customer();
            customer.CustomerId = 10;
            customer.EmailAddress = "bip@no.com";
            customer.Name = "Adam";
            return View(customer);
        }

        [ValidateAntiModelInjectionAttribute("CustomerId")]
        [HttpPost]
        public ActionResult Index(Customer customer)
        {
            return this.RedirectToAction("Index");
        }


    }
}
